package com.shensi.adminCollect.controller.station;

import com.baomidou.mybatisplus.extension.api.R;
import com.shensi.adminCollect.domain.station.dto.CustomListColumnDto;
import com.shensi.adminCollect.domain.station.vo.CustomListColumnVo;
import com.shensi.adminCollect.service.station.CustomListColumnService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "订单自定义字段")
@RestController
@RequestMapping("/customListColumn")
public class CustomListColumnController {

    @Autowired
    private CustomListColumnService customListColumnService;

    @PostMapping("/addListColumn")
    @ApiOperation("新增或修改自定义字段")
    public R addListColumn(@RequestBody CustomListColumnDto customListColumnDto) {
        return R.ok(customListColumnService.addListColumn(customListColumnDto));
    }

    @GetMapping("/selectListColumn")
    @ApiOperation("查询自定义字段")
    public R<CustomListColumnVo> selectListColumn(@RequestParam Integer tableId) {
        return R.ok(customListColumnService.selectListColumn(tableId));
    }
}
